home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / clipper / ks94an.zip / FILEBROW.HDR < prev    next >
Text File  |  1994-04-25  |  2KB  |  66 lines

  1. /******************************************************************************
  2.                  The Klipper Library, for CA-Clipper 5.x
  3.         Copyright (c), 1994, Wallace Information Systems Engineering
  4.  
  5. FUNCTION:
  6.  
  7. _FileBrowse( nFRow, nFCol, nTRow, nTCol, nHandle, nTabSpaces ) --> lFilePtr
  8.  
  9. PARAMETERS:
  10.  
  11. nFRow     : Window Coordinates
  12. nFCol     : ""
  13. nTRow     : ""
  14. nTCol     : ""
  15. nHandle   : file handle of previously opened file
  16. nTabSpaces: Number of spaces to convert tabs to (DEFAULT: 4)
  17.  
  18. SHORT:
  19.  
  20. Browse a text file  - will accomodate many megabytes in size.
  21.  
  22. DESCRIPTION:
  23.  
  24. _FileBrowse() is a, well, file browser.  The file to be browsed must have
  25. been previously opened.  Data on any line that falls beyond the right
  26. margin defined by the window coordinates is truncated (from view).
  27.  
  28. If nTabSpaces = 0, then no spaces are inserted in place of tabs and the tab
  29. character (chr(9)) is displayed.
  30.  
  31. NOTE:
  32.  
  33. In consideration of speed, nTabSpaces is NOT type checked any farther
  34. than NIL.  If it is NIL, no tab replacement occurs. If it is !NIL, then
  35. a numeric is expected and anything else will cause a run-time error.
  36.  
  37. Note that _FileBrowse() will change the current position of the file pointer
  38. returning it's last position as the functions return value.
  39.  
  40. Use PgUp and PgDn to view, and ESC to quit.
  41.  
  42. The file size is limited, theoretically, to approximately 8 MB in 25x80 mode.
  43. In 43x80, appx. 14 MB, and in 50x132, appx. 27 MB.
  44.  
  45. EXAMPLE:
  46.  
  47. FUNCTION main()
  48. LOCAL    nHandle
  49.  
  50. // assuming TEST.TXT is in the current directory
  51. nHandle = fopen("test.txt",FO_READ)
  52.  
  53. if ferror() = 0
  54.  
  55.     _FScreen('File Browse Test')
  56.     _PopBox(3,0,MaxRow(),MaxCol())
  57.     _FileBrowse(4,1,MaxRow()-1,MaxCol()-1,nHandle)
  58.  
  59.     fclose(nHandle)
  60.  
  61. endif
  62.  
  63. RETURN(NIL)
  64.  
  65. ******************************************************************************/
  66.